package message

import (
	"github.com/gin-gonic/gin"
)

// RegisterRoutes 注册消息模块路由
func RegisterRoutes(router *gin.RouterGroup, handler *Handler) {
	// 消息管理路由
	messageGroup := router.Group("/messages")
	{
		messageGroup.GET("", handler.ListMessages)
		messageGroup.POST("", handler.CreateMessage)
		messageGroup.GET("/:id", handler.GetMessage)
		messageGroup.PUT("/:id", handler.UpdateMessage)
		messageGroup.DELETE("/:id", handler.DeleteMessage)
	}

	// 用户消息路由
	userMessageGroup := router.Group("/users/:user_id/messages")
	{
		userMessageGroup.GET("", handler.GetUserMessages)
		userMessageGroup.POST("/:message_id/read", handler.ReadMessage)
		userMessageGroup.POST("/batch-read", handler.BatchReadMessages)
		userMessageGroup.DELETE("/:message_id", handler.DeleteUserMessage)
		userMessageGroup.POST("/batch-delete", handler.BatchDeleteUserMessages)
		userMessageGroup.GET("/unread-count", handler.CountUnreadMessages)
	}

	// 系统通知路由
	notificationGroup := router.Group("/notifications")
	{
		notificationGroup.POST("/system", handler.SendSystemNotification)
		notificationGroup.POST("/announcement", handler.SendAnnouncement)
	}
}
